Skip to content

Allow mmap of /sys/kernel/btf/vmlinux#8976

Closed
kernel-patches-daemon-bpf[bot] wants to merge 4 commits intobpf-next_basefrom
series/958810=>bpf-next
Closed

Allow mmap of /sys/kernel/btf/vmlinux#8976
kernel-patches-daemon-bpf[bot] wants to merge 4 commits intobpf-next_basefrom
series/958810=>bpf-next

Conversation

@kernel-patches-daemon-bpf
Copy link
Copy Markdown

Pull request for series with
subject: Allow mmap of /sys/kernel/btf/vmlinux
version: 5
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=964584

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: b615ce5
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=964584
version: 5

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: b615ce5
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=964584
version: 5

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: 25b6d5d
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=964584
version: 5

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: 4e2e684
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=964584
version: 5

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: d90f0bc
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=964584
version: 5

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: 5ead949
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=964584
version: 5

@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: 6888a03
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=964584
version: 5

@kernel-patches-daemon-bpf kernel-patches-daemon-bpf Bot force-pushed the series/958810=>bpf-next branch from 8e4d231 to af5c8a1 Compare May 22, 2025 22:19
@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: 6888a03
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=964584
version: 5

@kernel-patches-daemon-bpf kernel-patches-daemon-bpf Bot force-pushed the series/958810=>bpf-next branch from af5c8a1 to e8d88cf Compare May 22, 2025 23:06
lmb added 2 commits May 22, 2025 16:25
User space needs access to kernel BTF for many modern features of BPF.
Right now each process needs to read the BTF blob either in pieces or
as a whole. Allow mmaping the sysfs file so that processes can directly
access the memory allocated for it in the kernel.

remap_pfn_range is used instead of vm_insert_page due to aarch64
compatibility issues.

Tested-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
Reviewed-by: Shakeel Butt <shakeel.butt@linux.dev>
Add a basic test for the ability to mmap /sys/kernel/btf/vmlinux.
Ensure that the data is valid BTF and that it is padded with zero.

Tested-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

Upstream branch: 8259eb0
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=964584
version: 5

Teach libbpf to use mmap when parsing vmlinux BTF from /sys. We don't
apply this to fall-back paths on the regular file system because there
is no way to ensure that modifications underlying the MAP_PRIVATE
mapping are not visible to the process.

Acked-by: Andrii Nakryiko <andrii@kernel.org>
Tested-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Lorenz Bauer <lmb@isovalent.com>
@kernel-patches-daemon-bpf
Copy link
Copy Markdown
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=964584 irrelevant now. Closing PR.

@kernel-patches-daemon-bpf kernel-patches-daemon-bpf Bot deleted the series/958810=>bpf-next branch May 23, 2025 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant